package com.zd.service.lmpl;/**
 * @Description: WaybillServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-01
 * @Version:v1.0
 */

import com.zd.mapper.WaybillMapper;
import com.zd.service.lnter.WaybillServicelnter;
import com.zzg.entity.Waybill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: WaybillServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-01
 * @Version:v1.0
 */
@Service
public class WaybillServicelmpl implements WaybillServicelnter {
    @Autowired
    private WaybillMapper waybillMapper;


    /**
     * 查询所有运单信息
     *
     * @return 运单信息集合
     */
    @Override
    public List<Waybill> selectWaybill() {
        return waybillMapper.selectWaybill ();
    }

    /**
     * 通过运输单号查询运单详情
     * @param waybillid 运输id
     * @return 运单管理对象
     */
    @Override
    public Waybill selectWaybillByid(String waybillid) {
        return waybillMapper.selectWaybillByid(waybillid);
    }

    /**
     * 根据运单id删除运单
     *
     * @param waybillid 运单id
     * @return 返回数值判断是否删除成功
     */
    @Override
    public int delectWaybillByid(String waybillid) {
        return waybillMapper.delectWaybillByid (waybillid);
    }

    /**
     * 通过运单id修改运单信息
     *
     * @param waybillid          运单id
     * @param consignDate        托运日期
     * @param typeTransportation 运输类型
     * @param modeTransport      运输方式
     * @return
     */
    @Override
    public int updateWaybillByid(String waybillid, String consignDate, String typeTransportation, String modeTransport) {
        return waybillMapper.updateWaybillByid (waybillid,consignDate,typeTransportation,modeTransport);
    }
}
